package com.chunayev.numerology.domain;

import java.io.Serializable;
import java.util.Set;
import java.util.TreeSet;


import com.chunayev.numerology.util.db.DBConstants;
import com.sleepycat.persist.model.DeleteAction;
import com.sleepycat.persist.model.Entity;
import com.sleepycat.persist.model.PrimaryKey;
import com.sleepycat.persist.model.Relationship;
import com.sleepycat.persist.model.SecondaryKey;

/**
 * @author Sergey Chunayev
 */
@Entity
public class PositionSummary implements Serializable {
    
    /**
     * 
     */
    private static final long serialVersionUID = -5631830495634342106L;
    
    @SecondaryKey(relate = Relationship.MANY_TO_ONE, onRelatedEntityDelete = DeleteAction.NULLIFY)
    private Long chakraId;
    
    @SecondaryKey(relate = Relationship.ONE_TO_MANY, onRelatedEntityDelete = DeleteAction.NULLIFY)
    private Set<String> companyNames = new TreeSet<String>();
    
    private String description;
    
    @PrimaryKey(sequence = DBConstants.PositionSummarySequence)
    private long id;
    
    @SecondaryKey(relate = Relationship.ONE_TO_MANY, onRelatedEntityDelete = DeleteAction.NULLIFY)
    private Set<String> middlenames = new TreeSet<String>();
    
    @SecondaryKey(relate = Relationship.ONE_TO_MANY, onRelatedEntityDelete = DeleteAction.NULLIFY)
    private Set<String> names = new TreeSet<String>();
    
    private Plan plan;
    
    @SecondaryKey(relate = Relationship.MANY_TO_ONE, onRelatedEntityDelete = DeleteAction.NULLIFY)
    private Long planId;
    
    @SecondaryKey(relate = Relationship.ONE_TO_MANY, onRelatedEntityDelete = DeleteAction.NULLIFY)
    private Set<String> surnames = new TreeSet<String>();
    
    /**
     * @return the chakraId
     */
    public Long getChakraId() {
        return this.chakraId;
    }
    
    /**
     * @return the companyNames
     */
    public Set<String> getCompanyNames() {
        return this.companyNames;
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return this.description;
    }
    
    /**
     * @return the id
     */
    public long getId() {
        return this.id;
    }
    
    /**
     * @return the middlenames
     */
    public Set<String> getMiddlenames() {
        return this.middlenames;
    }
    
    /**
     * @return the names
     */
    public Set<String> getNames() {
        return this.names;
    }
    
    /**
     * @return the plan
     */
    public Plan getPlan() {
        return this.plan;
    }
    
    /**
     * @return the planId
     */
    public Long getPlanId() {
        return this.planId;
    }
    
    /**
     * @return the surnames
     */
    public Set<String> getSurnames() {
        return this.surnames;
    }
    
    /**
     * @param chakraId
     *            the chakraId to set
     */
    public void setChakraId(final Long chakraId) {
        this.chakraId = chakraId;
    }
    
    /**
     * @param companyNames
     *            the companyNames to set
     */
    public void setCompanyNames(final Set<String> companyNames) {
        this.companyNames = companyNames;
    }
    
    /**
     * @param description
     *            the description to set
     */
    public void setDescription(final String description) {
        this.description = description;
    }
    
    /**
     * @param id
     *            the id to set
     */
    public void setId(final long id) {
        this.id = id;
    }
    
    /**
     * @param middlenames
     *            the middlenames to set
     */
    public void setMiddlenames(final Set<String> middlenames) {
        this.middlenames = middlenames;
    }
    
    /**
     * @param names
     *            the names to set
     */
    public void setNames(final Set<String> names) {
        this.names = names;
    }
    
    /**
     * @param plan
     *            the plan to set
     */
    public void setPlan(final Plan plan) {
        this.plan = plan;
    }
    
    /**
     * @param planId
     *            the planId to set
     */
    public void setPlanId(final Long planId) {
        this.planId = planId;
    }
    
    /**
     * @param surnames
     *            the surnames to set
     */
    public void setSurnames(final Set<String> surnames) {
        this.surnames = surnames;
    }
}
